package com.antis.olsl.data.net;

import com.antis.olsl.base.net.BaseRetrofitManager;

import retrofit2.Retrofit;

/**
 * 网络请求使用开源Retrofit okhttp 框架
 */
public class RetrofitManager extends BaseRetrofitManager {

    private static RetrofitManager retrofitManager;
    private ApiServer apiServer;

    public static RetrofitManager getInstance() {
        if (retrofitManager == null) {
            retrofitManager = new RetrofitManager();
        }
        return retrofitManager;
    }

    public ApiServer getServerApi() {
        if (apiServer == null) {
            Retrofit retrofit = initRetrofit(BaseUrl.getBaseUrl());
            apiServer = retrofit.create(ApiServer.class);
        }
        return apiServer;
    }

}